package com.ak.demo.trigger;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;

import java.text.SimpleDateFormat;

public class HelloSimpleTrigger implements Job {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        Trigger trigger=context.getTrigger();
        SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        System.out.println("开始时间"+dateFormat.format(trigger.getStartTime()));
        System.out.println("结束时间"+dateFormat.format(trigger.getEndTime()));
        System.out.println();
    }
}
